<template>
  <h2 @click="pay">购买会员</h2>
</template>

<script>
import {pay} from "../../services/index"
export default {
       methods:{
        async pay(){
             let result =await pay({total_fee:1});
             console.log(result);
             
             let {timeStamp,nonceStr,paySign} =result.data;
            let params={
                 timeStamp,
                 nonceStr,
                 package: result.data.package,
                 signType: 'MD5',
                 paySign
             };
            wx.requestPayment(params)
           }
       }
}
</script>

<style>

</style>